import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LanguageDataVO, LanguageDataForm, LanguageDataQuery } from '@/api/mushcoin/languageData/types';

/**
 * 查询TG多国语言列表
 * @param query
 * @returns {*}
 */

export const listLanguageData = (query?: LanguageDataQuery): AxiosPromise<LanguageDataVO[]> => {
  return request({
    url: '/mushcoin/languageData/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询TG多国语言详细
 * @param id
 */
export const getLanguageData = (id: string | number): AxiosPromise<LanguageDataVO> => {
  return request({
    url: '/mushcoin/languageData/' + id,
    method: 'get'
  });
};

/**
 * 新增TG多国语言
 * @param data
 */
export const addLanguageData = (data: LanguageDataForm) => {
  return request({
    url: '/mushcoin/languageData',
    method: 'post',
    data: data
  });
};

/**
 * 修改TG多国语言
 * @param data
 */
export const updateLanguageData = (data: LanguageDataForm) => {
  return request({
    url: '/mushcoin/languageData',
    method: 'put',
    data: data
  });
};

/**
 * 删除TG多国语言
 * @param id
 */
export const delLanguageData = (id: string | number | Array<string | number>) => {
  return request({
    url: '/mushcoin/languageData/' + id,
    method: 'delete'
  });
};
